package org.springblade.modules.admin.service.approve.strategy;

import org.springblade.modules.admin.enums.ApproveTypeEnum;
import org.springblade.modules.admin.service.approve.MalfunctionFlow;
import org.springblade.modules.admin.service.approve.BuildingFlow;
import org.springblade.modules.admin.service.approve.PartsFlow;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 业务流程策略管理
 * @Author ysq
 * @Date 2021/12/7
 **/
public class ApproveBusinessStrategy {

	private static Map<Integer,ApproveBusinessFlow> businessStrategy = new HashMap<>();
	static {
		businessStrategy.put(ApproveTypeEnum.DATA_ALTER.getId(), new BuildingFlow());
		businessStrategy.put(ApproveTypeEnum.MALFUNCTION_APPLY.getId(), new MalfunctionFlow());
		businessStrategy.put(ApproveTypeEnum.ACCESSORY_APPLY.getId(), new PartsFlow());
	}

	public static ApproveBusinessFlow get(Integer approveType) {
		return businessStrategy.get(approveType);
	}
}
